package com.school.controller;

import com.school.entity.About;
import com.school.service.AboutService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/About")
public class AboutController {
    @Autowired
    AboutService service;

    // HttpServletRequest request, HttpServletResponse response

    @ResponseBody
    @RequestMapping("/getAll.do")
    public About[] getAll() {
        About[] abouts = service.selectAll();
        return abouts;
    }

    @ResponseBody
    @RequestMapping("/getOne.do")
    public About getAll(String about_name) {
        About about = service.selectOne(about_name);
        return about;
    }
}
